<template>
  <div>
    <a-row :gutter="24">
      <a-col :xl="8" :lg="24" :md="24" :sm="24" :xs="24">
        <a-card :loading="loading" title="添加分类" :bordered="false">
          <category-add
            ref="categoryAdd"
            @parentFn1="categoryListRefresh"
          />
        </a-card>
      </a-col>
      <a-col
        style="padding: 0 12px"
        :xl="16"
        :lg="24"
        :md="24"
        :sm="24"
        :xs="24">
        <a-card title="分类列表" style="margin-bottom: 24px" :bordered="false" >
          <category-list
            ref="categoryList"
            @parentFn2="categoryAddGetData"
          />
        </a-card>
      </a-col>
    </a-row>
  </div>
</template>

<script>
import categoryAdd from './categoryAdd'
import categoryList from './categoryList'
export default {
  name: 'Category',
  components: {
    categoryAdd,
    categoryList
  },
  data () {
    return {
      loading: false
    }
  },
  methods: {
    categoryListRefresh () {
      this.$refs.categoryList.frush()
    },
    categoryAddGetData (param) {
      var id = param.id
      var type = param.type
      this.$refs.categoryAdd.edit(id, type)
    }
  }
}
</script>

<style scoped>

</style>
